   * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      body {
        font-family: 'Arial', sans-serif;
        background: linear-gradient(to bottom, #001a33, #003366);
        color: white;
        overflow: hidden;
        user-select: none;
      }
      #app {
        position: relative;
        width: 100vw;
        height: 100vh;
      }
      #gameCanvas {
        position: absolute;
        top: 0;
        left: 0;
        background: linear-gradient(to bottom, #004080 0%, #0066cc 50%, #0080ff 100%);
        cursor: crosshair;
      }
      .game-ui {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        pointer-events: none;
        z-index: 10;
      }
      .game-ui > * {
        pointer-events: auto;
      }
      .controls {
        display: flex;
        gap: 15px;
        align-items: center;
      }
      .btn {
        padding: 10px 20px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        border-radius: 25px;
        color: white;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
      }
      .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
      }
      .btn:active {
        transform: translateY(0);
      }
      .btn.pause {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
      }
      .stats-panel {
        position: absolute;
        bottom: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.8);
        padding: 8px;
        border-radius: 15px;
        border: 2px solid #4a90e2;
        min-width: 250px;
      }
      .stat-item {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
        font-size: 14px;
      }
      .stat-label {
        color: #aaa;
      }
      .stat-value {
        color: #ffd700;
        font-weight: bold;
      }
      .progress-container {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 200px;
        background: rgba(0, 0, 0, 0.5);
        padding: 10px;
        border-radius: 10px;
        text-align: center;
      }
      .progress-bar {
        width: 100%;
        height: 20px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        overflow: hidden;
        margin-top: 5px;
      }
      .progress-fill {
        height: 100%;
        background: linear-gradient(to right, #4caf50, #8bc34a);
        transition: width 0.3s ease;
      }
      .reward-modal {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.95);
        padding: 30px;
        border-radius: 20px;
        text-align: center;
        border: 3px solid #ffd700;
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
        display: none;
        z-index: 100;
      }
      .reward-modal.show {
        display: block;
      }
      .reward-modal h2 {
        color: #ffd700;
        font-size: 28px;
        margin-bottom: 20px;
      }
      .cards-container {
        display: flex;
        gap: 20px;
        justify-content: center;
        margin-top: 20px;
      }
      .reward-card {
        width: 150px;
        height: 200px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 15px;
        padding: 15px;
        cursor: pointer;
        transition: all 0.3s ease;
        border: 2px solid transparent;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
      }
      .reward-card:hover {
        transform: translateY(-10px);
        border-color: #ffd700;
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
      }
      .reward-card.level-2 {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        border: 2px solid #ffd700;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
      }
      .reward-card.level-2:hover {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
      }
      .reward-card.level-2::before {
        content: '高级';
        position: absolute;
        top: 5px;
        right: 5px;
        background: #ffd700;
        color: #333;
        font-size: 12px;
        font-weight: bold;
        padding: 2px 8px;
        border-radius: 10px;
        z-index: 1;
      }
      .card-icon {
        font-size: 48px;
        margin-bottom: 10px;
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
      }
      .card-title {
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 5px;
        text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
      }
      .card-value {
        font-size: 14px;
        color: #ffd700;
        font-weight: bold;
        text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
      }
      .cards-area {
        position: absolute;
        bottom: 20px;
        right: 20px;
        display: flex;
        gap: 10px;
      }
      .active-card {
        width: 80px;
        height: 100px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 10px;
        padding: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 2px solid #4a90e2;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
      }
      .active-card:hover {
        transform: scale(1.1);
      }
      .active-card.level-2 {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        border: 2px solid #ffd700;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
      }
      .active-card.level-2::before {
        content: '高级';
        position: absolute;
        top: 2px;
        right: 2px;
        background: #ffd700;
        color: #333;
        font-size: 10px;
        font-weight: bold;
        padding: 1px 5px;
        border-radius: 8px;
        z-index: 1;
      }
      .active-card .card-icon {
        font-size: 24px;
        margin-bottom: 5px;
      }
      .active-card .card-value {
        font-size: 12px;
      }
      .game-over-modal {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.9);
        padding: 40px;
        border-radius: 20px;
        text-align: center;
        border: 3px solid #ffd700;
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
        display: none;
        z-index: 100;
      }
      .game-over-modal.show {
        display: block;
      }
      .game-over-modal h2 {
        color: #ffd700;
        font-size: 36px;
        margin-bottom: 20px;
      }
      .final-score {
        font-size: 24px;
        margin-bottom: 30px;
      }
      .cannon-charge {
        position: absolute;
        bottom: 150px;
        left: 50%;
        transform: translateX(-50%);
        width: 250px;
        height: 25px;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 15px;
        overflow: hidden;
        display: none;
        border: 2px solid #ffd700;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
      }
      .cannon-charge.show {
        display: block;
        animation: pulse 1.5s infinite;
      }
      @keyframes pulse {
        0% {
          box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
        }
        50% {
          box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
        }
        100% {
          box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
        }
      }
      .charge-fill {
        height: 100%;
        background: linear-gradient(to right, #ff0000, #ffff00, #00ff00);
        width: 0%;
        transition: width 0.1s linear;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
      }
      .info-modal {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.95);
        padding: 30px;
        border-radius: 20px;
        text-align: center;
        border: 3px solid #4a90e2;
        box-shadow: 0 0 50px rgba(74, 144, 226, 0.5);
        display: none;
        z-index: 100;
        max-width: 400px;
      }
      .info-modal.show {
        display: block;
      }
      .info-modal h2 {
        color: #4a90e2;
        font-size: 28px;
        margin-bottom: 20px;
      }
      .info-content {
        margin-bottom: 20px;
        line-height: 1.8;
        font-size: 16px;
      }
      .info-content p {
        margin-bottom: 10px;
      }
      .close-btn {
        display: block;
        margin: 0 auto;
        padding: 10px 30px;
        background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
      }
      .swap-modal {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.95);
        padding: 30px;
        border-radius: 20px;
        text-align: center;
        border: 3px solid #ff6b6b;
        box-shadow: 0 0 50px rgba(255, 107, 107, 0.5);
        display: none;
        z-index: 100;
      }
      .swap-modal.show {
        display: block;
      }
      .swap-modal h2 {
        color: #ff6b6b;
        font-size: 24px;
        margin-bottom: 20px;
      }
      .swap-modal p {
        margin-bottom: 20px;
        font-size: 16px;
      }
      .swap-buttons {
        display: flex;
        gap: 20px;
        justify-content: center;
      }
      .score-popup {
        animation: score-float 1s ease-out forwards;
      }
      @keyframes score-float {
        0% {
          transform: translateY(0);
          opacity: 1;
        }
        100% {
          transform: translateY(-50px);
          opacity: 0;
        }
      }
      .insufficient-coins {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(255, 0, 0, 0.8);
        color: white;
        padding: 15px 30px;
        border-radius: 10px;
        font-size: 20px;
        font-weight: bold;
        z-index: 50;
        display: none;
        animation: shake 0.5s ease-in-out;
      }
      .insufficient-coins.show {
        display: block;
      }
      @keyframes shake {
        0%,
        100% {
          transform: translate(-50%, -50%) translateX(0);
        }
        25% {
          transform: translate(-50%, -50%) translateX(-10px);
        }
        75% {
          transform: translate(-50%, -50%) translateX(10px);
        }
      }

      /* 添加一些必要的样式 */
      .bullet-level-selector {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 10px;
        padding: 5px;
        z-index: 10;
      }

      .bullet-level {
        padding: 10px 15px;
        margin: 0 5px;
        border-radius: 5px;
        cursor: pointer;
        color: white;
        font-weight: bold;
        transition: all 0.3s;
      }

      .bullet-level.active {
        background: #4caf50;
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
      }

      .bullet-level:not(.active) {
        background: #555;
      }

      .bullet-level:hover:not(.active) {
        background: #666;
      }

      .bullet-cost {
        font-size: 12px;
        color: #ffd700;
      }
      /* 开始游戏界面样式 */
      .start-screen {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #001a33 0%, #003366 100%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 200;
      }

      .game-title {
        font-size: 48px;
        font-weight: bold;
        color: #ffd700;
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
        margin-bottom: 50px;
        letter-spacing: 3px;
        animation: glow 2s ease-in-out infinite alternate;
      }

      .start-button {
        padding: 20px 40px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        border-radius: 30px;
        color: white;
        font-size: 24px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
      }

      .start-button:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
      }

      /* 奖励事件倒计时样式 */
      .reward-event-timer {
        position: absolute;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.7);
        padding: 10px 20px;
        border-radius: 20px;
        border: 2px solid #ffd700;
        color: white;
        font-size: 16px;
        font-weight: bold;
        display: flex;
        align-items: center;
        z-index: 20;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
      }

      .reward-event-timer .timer-text {
        margin-right: 10px;
      }

      .reward-event-timer .timer-value {
        color: #ffd700;
        font-size: 18px;
        min-width: 50px;
        text-align: center;
      }

      /* 宝箱样式 */
      .treasure-chest-timer {
        position: absolute;
        background: rgba(0, 0, 0, 0.7);
        padding: 5px 10px;
        border-radius: 10px;
        border: 1px solid #ffd700;
        color: white;
        font-size: 14px;
        font-weight: bold;
        text-align: center;
        transform: translateX(-50%);
        z-index: 15;
        white-space: nowrap;
      }

      /* 奖励卡牌模态框样式 */
      .treasure-reward-modal {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.95);
        padding: 30px;
        border-radius: 20px;
        text-align: center;
        border: 3px solid #ffd700;
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
        display: none;
        z-index: 100;
      }

      .treasure-reward-modal.show {
        display: block;
      }

      .treasure-reward-modal h2 {
        color: #ffd700;
        font-size: 28px;
        margin-bottom: 20px;
      }

      .treasure-card-container {
        display: flex;
        justify-content: center;
        margin-top: 20px;
      }

      .treasure-card {
        width: 200px;
        height: 250px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 15px;
        padding: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        border: 2px solid transparent;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
      }

      .treasure-card:hover {
        transform: translateY(-10px);
        border-color: #ffd700;
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
      }

      .treasure-card.legendary {
        background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
        border: 2px solid #ff4500;
        box-shadow: 0 0 30px rgba(255, 69, 0, 0.7);
      }

      .treasure-card.epic {
        background: linear-gradient(135deg, #9370db 0%, #8a2be2 100%);
        border: 2px solid #9932cc;
        box-shadow: 0 0 25px rgba(153, 50, 204, 0.7);
      }

      .treasure-card.rare {
        background: linear-gradient(135deg, #4169e1 0%, #1e90ff 100%);
        border: 2px solid #00bfff;
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.7);
      }

      .treasure-card.common {
        background: linear-gradient(135deg, #708090 0%, #2f4f4f 100%);
        border: 2px solid #778899;
        box-shadow: 0 0 15px rgba(119, 136, 153, 0.7);
      }

      .treasure-card.legendary::before {
        content: '传说';
        position: absolute;
        top: 5px;
        right: 5px;
        background: #ff4500;
        color: white;
        font-size: 12px;
        font-weight: bold;
        padding: 2px 8px;
        border-radius: 10px;
        z-index: 1;
      }

      .treasure-card.epic::before {
        content: '史诗';
        position: absolute;
        top: 5px;
        right: 5px;
        background: #9932cc;
        color: white;
        font-size: 12px;
        font-weight: bold;
        padding: 2px 8px;
        border-radius: 10px;
        z-index: 1;
      }

      .treasure-card.rare::before {
        content: '稀有';
        position: absolute;
        top: 5px;
        right: 5px;
        background: #00bfff;
        color: white;
        font-size: 12px;
        font-weight: bold;
        padding: 2px 8px;
        border-radius: 10px;
        z-index: 1;
      }

      .treasure-card.common::before {
        content: '普通';
        position: absolute;
        top: 5px;
        right: 5px;
        background: #778899;
        color: white;
        font-size: 12px;
        font-weight: bold;
        padding: 2px 8px;
        border-radius: 10px;
        z-index: 1;
      }

      .treasure-card-icon {
        font-size: 60px;
        margin-bottom: 15px;
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.7));
      }

      .treasure-card-title {
        font-size: 18px;
        font-weight: bold;
        margin-bottom: 10px;
        text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
      }

      .treasure-card-value {
        font-size: 16px;
        color: #ffd700;
        font-weight: bold;
        text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
      }

      .treasure-card-description {
        font-size: 14px;
        color: #ffffff;
        margin-top: 10px;
        text-align: center;
        line-height: 1.4;
      }

      /* 子弹选择器样式 */
      .bullet-selector {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        background-color: rgba(0, 0, 0, 0.6);
        border-radius: 10px;
        padding: 5px;
        z-index: 10;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
      }

      .bullet-option {
        display: flex;
        align-items: center;
        gap: 3px;
        padding: 5px 8px;
        margin: 0 2px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.1s;
        min-width: 60px;
      }

      .bullet-option:hover {
        background-color: rgba(255, 255, 255, 0.1);
      }

      .bullet-option.active {
        background-color: rgba(255, 255, 255, 0.2);
        border: 2px solid #ffd700;
      }

      .bullet-name {
        color: white;
        font-size: 12px;
        margin-bottom: 1px;
        font-weight: bold;
        line-height: 12px;
      }

      .bullet-cost {
        color: #ffd700;
        font-size: 9px;
      }

      /* 统计面板展开收起功能 - 重构版本 */
      .stats-panel {
        position: absolute;
        bottom: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.8);
        border-radius: 15px;
        border: 2px solid #4a90e2;
        min-width: 180px;
        transition: all 0.3s ease;
        overflow: visible;
        padding: 5px;
      }

      .stats-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px;
        cursor: pointer;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      }

      .stats-header h3 {
        margin: 0;
        color: #4a90e2;
        font-size: 16px;
      }

      .stats-toggle {
        color: #4a90e2;
        font-size: 18px;
        transition: transform 0.3s ease;
      }

      .stats-panel.collapsed .stats-toggle {
        transform: rotate(180deg);
      }

      /* 主要信息区域 - 始终显示 */
      .stats-primary {
        padding: 5px;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      .stat-primary-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 16px;
        font-weight: bold;
      }

      .stat-primary-item .stat-label {
        color: #fff;
      }

      .stat-primary-item .stat-value {
        color: #ffd700;
        font-size: 18px;
      }

      /* 详细信息区域 - 可折叠 */
      .stats-details {
        padding: 5px;
        max-height: 200px;
        overflow: hidden;
        transition: all 0.3s ease;
      }

      .stats-panel.collapsed .stats-details {
        max-height: 0;
        padding: 0 5px;
        overflow: hidden;
      }

      .stat-item {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
        font-size: 14px;
      }

      .stat-item:last-child {
        margin-bottom: 0;
      }

      .stat-label {
        color: #aaa;
      }

      .stat-value {
        color: #ffd700;
        font-weight: bold;
      }